package com.yb.core.exception;

import com.yb.core.constant.HttpConstant;
import lombok.Data;

@Data
public class YbBusinessException extends RuntimeException{
    private Integer code=HttpConstant.Response.ERROR.getCode();
    private String msg=HttpConstant.Response.ERROR.getMsg();
    private Object data;

    public YbBusinessException(){

    }

    public YbBusinessException(Object data){
        this.data=data;
    }
    public YbBusinessException(Integer code,String msg){
        this.code=code;
        this.msg=msg;
    }

    public YbBusinessException(Integer code,String msg,Object data){
        this.code=code;
        this.msg=msg;
        this.data=data;
    }


    public YbBusinessException(HttpConstant.Response response){
        this.code=response.getCode();
        this.msg=response.getMsg();
    }
}
